package com.forur.stubootstarter4.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.forur.stubootstarter4.entity.Month;
import com.forur.stubootstarter4.mapper.MonthMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MonthServiceImpl implements MonthService{

    @Autowired
    private MonthMapper monthMapper;

    @Override
    public void add(Month month) {
        monthMapper.insert(month);
    }

    @Override
    public void find(int monthNum) {
        QueryWrapper<Month> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("month_num", monthNum);
        List<Month> months =  monthMapper.selectList(queryWrapper);
        System.out.println(months);
    }
}
